<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 400px;
            height: 400px;
            border: 1px solid #000;
            text-align: center;
        }
    </style>
</head>
<body>
    <div>
    <span>x:</span>
    <span>y:</span>
    </div>
    <script>
        let x = Number.parseInt(document.querySelector("click").innerHTML);
        let y = e.clientY;
         document.addEventListener('click',function(e){
        console.log(e.clientX);
        console.log(e.clientY);
    })
    </script>
</body>
</html>